package br.ufrn.btest.decorators.predicates;

import de.be4.classicalb.core.parser.node.ABelongPredicate;
import de.be4.classicalb.core.parser.node.AConjunctPredicate;
import de.be4.classicalb.core.parser.node.ADisjunctPredicate;
import de.be4.classicalb.core.parser.node.AEqualPredicate;
import de.be4.classicalb.core.parser.node.AGreaterEqualPredicate;
import de.be4.classicalb.core.parser.node.AGreaterPredicate;
import de.be4.classicalb.core.parser.node.AImplicationPredicate;
import de.be4.classicalb.core.parser.node.AIncludePredicate;
import de.be4.classicalb.core.parser.node.AIncludeStrictlyPredicate;
import de.be4.classicalb.core.parser.node.ALessEqualPredicate;
import de.be4.classicalb.core.parser.node.ALessPredicate;
import de.be4.classicalb.core.parser.node.ANegationPredicate;
import de.be4.classicalb.core.parser.node.ANotBelongPredicate;
import de.be4.classicalb.core.parser.node.AUnequalPredicate;
import de.be4.classicalb.core.parser.node.AUniversalQuantificationPredicate;
import de.be4.classicalb.core.parser.node.PPredicate;

public class MyPredicateFactory {

	public static MyPredicate convertPredicate(PPredicate predicate) {

		if (predicate instanceof ABelongPredicate) {
			return new MyABelongPredicate((ABelongPredicate) predicate);
		} else if (predicate instanceof AConjunctPredicate) {
			return new MyAConjunctPredicate((AConjunctPredicate) predicate);
		} else if (predicate instanceof ADisjunctPredicate) {
			return new MyADisjunctPredicate((ADisjunctPredicate) predicate);
		} else if (predicate instanceof AEqualPredicate) {
			return new MyAEqualPredicate((AEqualPredicate) predicate);
		} else if (predicate instanceof AGreaterEqualPredicate) {
			return new MyAGreaterEqualPredicate((AGreaterEqualPredicate) predicate);
		} else if (predicate instanceof AGreaterPredicate) {
			return new MyAGreaterPredicate((AGreaterPredicate) predicate);
		} else if (predicate instanceof AImplicationPredicate) {
			return new MyAImplicationPredicate((AImplicationPredicate) predicate);
		} else if (predicate instanceof AIncludePredicate) {
			return new MyAIncludePredicate((AIncludePredicate) predicate);
		} else if (predicate instanceof ALessEqualPredicate) {
			return new MyALessEqualPredicate((ALessEqualPredicate) predicate);
		} else if (predicate instanceof ALessPredicate) {
			return new MyALessPredicate((ALessPredicate) predicate);
		} else if (predicate instanceof ANegationPredicate) {
			return new MyANegationPredicate((ANegationPredicate) predicate);
		} else if (predicate instanceof ANotBelongPredicate) {
			return new MyANotBelongPredicate((ANotBelongPredicate) predicate);
		} else if (predicate instanceof AUnequalPredicate) {
			return new MyAUnequalPredicate((AUnequalPredicate) predicate);
		} else if (predicate instanceof AUniversalQuantificationPredicate) {
			return new MyAUniversalQuantificationPredicate((AUniversalQuantificationPredicate) predicate);
		} else if (predicate instanceof AIncludeStrictlyPredicate) {
			return new MyAIncludeStrictlyPredicate((AIncludeStrictlyPredicate) predicate);
		} else {
			System.out.println("Couldnt find decorator for " + predicate.getClass().getName());
			return null;
		}
	}

}
